package com.laikan.reader.bookfriend.requester;

import com.laikan.library.httpvolley.helper.RequestListener;
import com.laikan.library.httpvolley.helper.VolleyErrorHandler;
import com.laikan.library.httpvolley.response.HttpResponse;
import com.laikan.reader.bookfriend.base.IView;

/**
 * Created by lingyt on 2016/11/22.
 */
public abstract class SimpleRequestListener implements RequestListener{

    private IView mView;

    public SimpleRequestListener(IView view){
        mView = view;
    }

    @Override
    public void onPreExecute() {
        mView.showProgress();
    }

    @Override
    public abstract void onSuccess(HttpResponse httpResponse);

    @Override
    public abstract void onError(VolleyErrorHandler errorHandler);

    @Override
    public void onFinish() {
        mView.hideProgress();
    }
}
